package dao

import (
	"datum_user_rpc/config"
	"github.com/go-redis/redis"
)

var RedisClient *redis.Client

func GetRedisClient(db int) *redis.Client {
	return redis.NewClient(&redis.Options{
		Addr:     config.GetString("redis.addr"),
		Password: config.GetString("redis.password"),
		DB:       db, // use default DB
	})
}

func InitRedisClient() *redis.Client {
	RedisClient = GetRedisClient(0)
	return RedisClient
}
